<?php
namespace Admin\Controller;
use Think\Controller;
class TaskController extends Controller {
    /**
     * 已发货订单自动确认收货
     */
    public function checkShip(){
        $list = M('order_info')->where(" order_status = 1 and pay_status =2 and shipping_status = 1 ")->field('order_id,shipping_status')->select();
        foreach($list as $v){
            \Com\Order::checkShipStatus($v['order_id'],$v['shipping_status']);
        }
    }
    /**
     * 添加每日返回金额
    */
    public function addBackLog(){
        $way = php_sapi_name();
        $data['backDate'] = date('Ymd',time());
        $data['back1']    = 1.5;
        $data['back2']    = 2;
        $data['back3']    = 6.1;
        $where = "backdate = " . $data['backDate'];
        $exist = M('back_log')->where($where)->find();
        if(empty($exist)){
            M('back_log')->add($data);
        }
    }
}